<?php
require 'vendor/autoload.php';

use OpenApi\Generator as OpenApiGenerator;

$openapi = OpenApiGenerator::scan([__DIR__ . '/application/controllers']);
file_put_contents(__DIR__ . '/public/swagger.json', $openapi->toJson());

// 输出 JSON 格式的 API 文档
header('Content-Type: application/json');
echo $openapi->toJson();
